package game;

import java.awt.Graphics2D;
import java.awt.Point;

class Level_01 extends BaseLevel
{
	float timeAnimationEnemie = 0.05f;
	
	
	public enum levelTime
	{
		Intro,
		Game,
	}
	public levelTime gameTime = levelTime.Game;
	
	
	public Level_01()
	{
		super();
		this.sizeMap = new Point(1200, 1200);
		respawn = new Respawn(new Point(925,725),8,  3.5f);
		mapa = new Mapa_01(this.sizeMap);
		super.Initialze();
		
		player.intMine=3;
		CapacitorManager.getInstance().maxEnimie = 10;
		CapacitorManager.getInstance().minEnimie = 5;
		
	}
	public void update()
    {   
    	super.update(Mapa_01.getObstaculos());
    	mapa.Update();
    
    	if(this.gameTime == levelTime.Game)
    	{
 
	    	switch(Game.rand.nextInt(4))
	    	{
				case 0:
					respawn.Update(new Inimigo_01(15,
							super.PosicaoInicialInimigo(mapa.getPosition(), sizeMap),
							new Point(40,40),
							new Point(0,0), 
							new Point(40,40),
			    			new Point(3,1),
			    			timeAnimationEnemie,
			    			true,
			    			100,
			    			3.5f),
			    			player,
			    			Mapa_01.getObstaculos(),
			    			3);
					break;
		
				case 1:
					respawn.Update(new Inimigo_02(16,
							super.PosicaoInicialInimigo(mapa.getPosition(), sizeMap),
							new Point(40,40),
							new Point(0,0), 
			    			new Point(40,40),
			    			new Point(4,1),
			    			timeAnimationEnemie,
			    			true,
			    			100,
			    			3.5f),
			    			player,
			    			Mapa_01.getObstaculos(),
			    			3);
			    	
					break;
		
				case 2:
					respawn.Update(new Inimigo_01(15,
							super.PosicaoInicialInimigo(mapa.getPosition(), sizeMap),
							new Point(40,40),
							new Point(0,0), 
			    			new Point(40,40),
			    			new Point(3,1),
			    			timeAnimationEnemie,
			    			true,
			    			100,
			    			3.5f),
			    			player,
			    			Mapa_01.getObstaculos(),
			    			3);
			    	break;
			
				case 3:
					respawn.Update(new Inimigo_01(15,
							super.PosicaoInicialInimigo(mapa.getPosition(), sizeMap),
							new Point(40,40),
							new Point(0,0), 
							new Point(40,40),
			    			new Point(3,1),
			    			timeAnimationEnemie, 
			    			true,
			    			100,
			    			3.5f),
			    			player,
			    			Mapa_01.getObstaculos(),
			    			3);
			    	break;
	    	}
    	}
    }
	
	public void draw(Graphics2D g2d)
    {
        g2d.drawString("LEVEL: " + 0, 10, 10);
        super.draw(g2d);
        mapa.draw(g2d);
        super.Draw2(g2d);
        
        for(int i = 0; i< Inimigo_04.bombs.size(); i++)
			Inimigo_04.bombs.get(i).draw(g2d);
    }
}
